package com.kangye.learnstudent.service.impl;

import com.kangye.learnstudent.entity.Paper;
import com.kangye.learnstudent.entity.StudentPaper;
import com.kangye.learnstudent.mapper.PaperMapper;
import com.kangye.learnstudent.service.PaperService;
import com.kangye.learnstudent.util.ViewJsonObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @program: learndeduo
 * @description: 实现试卷逻辑接口
 * @author: 索腾龙
 * @create: 2021-05-17 11:04
 **/
@Service
@Transactional
public class PaperServiceImpl implements PaperService {
    @Autowired
    private PaperMapper paperMapper;
    //根据试卷id查询题目id
    @Override
    public ViewJsonObject<Paper> selPaper(Integer paperStudentPaperId) {
        List<Paper> list = paperMapper.selPaper(paperStudentPaperId);
        return new ViewJsonObject<>(list);
    }

    //提交修改学生的答案是否正确 和学生的答案
    @Override
    public Integer updPaper(Paper paper) {
        return paperMapper.updPaper(paper);
    }
}